package com.haoStudy;

import java.util.Scanner;

public class Calculate {

	public static double cal(Fruit fruit) {
		Scanner scanner=new Scanner(System.in);
		System.out.println("请输入要购买的数量");
		double num=scanner.nextDouble();
		if (fruit instanceof Strawberry) {
			return fruit.sell(num)*0.8;
		}else {
		
			return fruit.sell(num);
		}
	}
}
